{
  "properties" : { },
  "id" : "e32cae4332e641e99a3d80ce42cb2737",
  "script" : null,
  "groupId" : "a0ba9516f241448baf3222405321ab3c",
  "name" : "查看历史记录",
  "createTime" : 1727071180706,
  "updateTime" : 1725435994268,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "/page",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : " {\r\n     \"current\": 1,\r\n     \"size\": 10,\r\n     \"deviceName\": \"榆林卓易风电场\"\r\n }",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"status\": 200,\n    \"message\": \"success\",\n    \"data\": {\n        \"total\": 1,\n        \"current\": 1,\n        \"size\": 10,\n        \"records\": [\n            {\n                \"id\": \"1826448300194246658\",\n                \"remoteIp\": \"61.2.15.16\",\n                \"openTime\": \"2024-08-22 10:34:53\",\n                \"deviceId\": \"D1354730371114623818\",\n                \"closeTime\": \"2024-08-22 10:36:23\",\n                \"localIp\": \"198.10.102.21\",\n                \"deviceName\": \"SN-YL.ZhuoYiFD.R\",\n                \"localUser\": \"管理员\",\n                \"rowId\": \"1\"\n            }\n        ]\n    }\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "current",
      "value" : "1",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "size",
      "value" : "10",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "deviceId",
      "value" : "D35267890407105919061",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "status",
      "value" : "200",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "success",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================

if(body==null){
    return null;
}
// var ipData = db.table('ndmp_device').column('ip').where().eq('id',body.deviceId).selectOne();
// if(ipData==null){
//     return null;
// }
// body.ip = ipData.ip;
var sql = """
  select rm.id,remote_ip,open_time,device_id,
        close_time,local_ip,  dev.device_name  ,us.name local_user from ndmp_remote_msg rm
        left join  ndmp_device dev
        on rm.device_id=dev.id
        left join blade_user us  on rm.local_user=us.id
        where 1=1
        <if test="body.localUser != null and body.localUser != ''">
            and us.name  like concat('%', #{body.localUser}, '%')
        </if>
        <if test="body.deviceName != null and body.deviceName != ''">
            and (dev.device_alias like   concat('%',#{body.deviceName}, '%') or
            dev.device_name like   concat('%',#{body.deviceName}, '%') )
        </if>
        <if test="body.start != null and body.start != '' and body.end != null and body.end != ''">
            and  open_time BETWEEN  #{body.start} and #{body.end}
        </if>

        order by open_time desc
        """
return db.page(sql,body.size,body.current-1)